1. Field of the Invention
The present invention relates to an image processing apparatus, a method of controlling the same, and a storage medium, and more particularly to an image processing apparatus that performs gradation correction of a photographed image obtained through photographing.
2. Description of the Related Art
In general, in an image processing apparatus, such as a digital camera, to obtain a photographed image having desired brightness and contrast, an object image in the photographed image and photographing information on a photographed scene are analyzed to perform gradation correction of the photographed image.
Particularly, in an image photographed in a so-called backlight scene in which the brightness of an object, such as a person, is markedly lower than that of background, an object image becomes dark. To overcome this problem, by performing gradation correction of the object image, it is possible to obtain a photographed image having desired brightness and contrast.
By the way, to obtain a photographed image having desired brightness and contrast, there has been proposed an image processing apparatus configured to perform a dynamic range-increasing process or a dynamic range-reducing process according to a photographed scene (see Japanese Patent Laid-Open Publication No. 2010-193099). In Japanese Patent Laid-Open Publication No. 2010-193099, when the dynamic range-increasing process is performed, an image is photographed by reducing imaging sensitivity, and gradation correction is performed on the photographed image so as to compensate for reduction of the imaging sensitivity.
Further, there has been proposed an image processing apparatus configured to determine whether or not to perform gradation correction, according to an exposure at which an image is photographed (Japanese Patent Laid-Open Publication No. 2012-44559). In Japanese Patent Laid-Open Publication No. 2012-44559, to suppress so-called blown-out highlights (saturated pixels), a maximum exposure value is determined within which the reduction of the imaging sensitivity can be compensated for by gradation correction, and when an image is photographed, if an exposure value is smaller than the maximum exposure value, gradation correction is performed, whereas if the exposure value is not smaller than the maximum exposure value, gradation correction is not performed.
However, in the methods described in Japanese Patent Laid-Open Publication No. 2010-193099 and Japanese Patent Laid-Open Publication No. 2012-44559, gradation correction is performed on an entire image such that the brightness of a single object image is made appropriate, and hence the contrast of object images is reduced, resulting in a so-called sleepy image.